package com.qf.hello.spring.service.impl;


import com.qf.hello.spring.dao.UserDao;
import com.qf.hello.spring.entity.User;
import com.qf.hello.spring.service.UserService;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;

public class UserServiceImpl implements UserService {

    //注入userDao对象,以前的做法
//    private UserDao userDao=new UserDaoImpl();

    //声明属性，提供set/get方法
    private UserDao userDao;

/*    public UserDao getUserDao() {
        return userDao;
    }*/

    public void setUserDao(UserDao userDao) {
        System.out.println("调用set方法赋值");
        this.userDao = userDao;
    }

    @Override
    public int deleteUserById(Integer id) {

        System.out.println("删除业务层用户");
        return userDao.deleteById(1);
    }

    public void initQf(){
        System.out.println("自定义初始化方法");
    }

    public void destoryQf(){
        System.out.println("自定义销毁方法");
    }
}
